package com.edu.v2.compile.parser;

import com.edu.compile.Parser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

/**
 * @author zhanshen zhanshen.xu@tuya.com
 * @class FullLongParser
 * @since 2021/7/30
 */
@Component
public class LongParser implements Parser<String, Long> {

    @Override
    public Long parse(String value) {
        if (value == null) {
            return null;
        }

        if (StringUtils.isEmpty(value)) {
            return null;
        }
        return Long.valueOf(value);
    }
}
